package com.hk.core.authentication.api.validatecode;

import java.io.IOException;

/**
 * 验证码处理器
 *
 * @author kevin
 * @date 2018-07-27 13:37
 */
public interface ValidateCodeProcessor<C extends ValidateCode> {

    /**
     * 创建验证码
     *
     * @param phone phone
     * @return 验证码
     */
    C create(C validateCode) throws IOException;

    /**
     * 校验验证码
     *
     * @param validateCode validateCode
     * @throws ValidateCodeException 验证码验证异常
     */
    void validate(C validateCode) throws ValidateCodeException;
}
